/PROG  PNS0190
/ATTR
OWNER		= MNEDITOR;
COMMENT		= "CE SHI";
PROG_SIZE	= 4627;
CREATE		= DATE 18-06-24  TIME 08:43:36;
MODIFIED	= DATE 18-06-25  TIME 09:49:14;
FILE_NAME	= PNS0037;
VERSION		= 0;
LINE_COUNT	= 174;
MEMORY_SIZE	= 5163;
PROTECT		= READ_WRITE;
TCD:  STACK_SIZE	= 0,
      TASK_PRIORITY	= 50,
      TIME_SLICE	= 0,
      BUSY_LAMP_OFF	= 0,
      ABORT_REQUEST	= 0,
      PAUSE_REQUEST	= 0;
DEFAULT_GROUP	= 1,*,*,*,*;
CONTROL_CODE	= 00000000 00000000;
/APPL
/MN
   1:  !******************************** ;
   2:  !     COSMA METAL FORMING  ;
   3:  !******************************** ;
   4:  !  LINE: CHINA CHANGSHA ;
   5:  !  ROBOT: R23 ;
   6:  !  PROGRAM: PNS0190 ;
   7:  !  PART:51947408/09  ;
   8:  !  AUTHOR:HL ;
   9:  !******************************** ;
  10:   ;
  11:  !INITIALIZE ;
  12:  MOVE TO HOME    ;
  13:  R[14:CG SENSETIVE]=75    ;
  14:  R[18:PICK TIME BEFORE]=1    ;
  15:  R[19:DROP TIME BEFORE]=.2    ;
  16:   ;
  17:  !------------------------------- ;
  18:  !BEGINNING OF PROGRAM ;
  19:  CALL PARTDROP    ;
  20:  COL GUARD ADJUST R[14] ;
  21:  UTOOL_NUM=1 ;
  22:  UFRAME_NUM=0 ;
  23:  PAYLOAD[3] ;
  24:   ;
  25:  !INITIATE TO PICK-POUNCE ;
  26:J P[1:MIDDLE] 50% CNT100 ACC100    ;
  27:J P[2:PICK POUNCE] 50% CNT100 ACC100 BREAK    ;
  28:   ;
  29:  R[1:CYCLE TOTAL]=0    ;
  30:  TIMER[1]=RESET ;
  31:  TIMER[1]=START ;
  32:   ;
  33:  LBL[10:TOP OF LOOF] ;
  34:  OVERRIDE=R[5:SPEED           ] ;
  35:   ;
  36:  TIMER[3]=STOP ;
  37:  TIMER[2]=STOP ;
  38:  R[1:CYCLE TOTAL]=R[1:CYCLE TOTAL]+1    ;
  39:  R[2:LAST CYCLE TIME]=TIMER[2]    ;
  40:  R[3:LAST SPM]=60/R[2:LAST CYCLE TIME]    ;
  41:  R[8:R MOVE TIME]=TIMER[3]    ;
  42:  TIMER[2]=RESET ;
  43:  TIMER[2]=START ;
  44:  TIMER[3]=RESET ;
  45:   ;
  46:  !PROCEED TO PICK ;
  47:  LBL[20] ;
  48:  IF DI[1:P3 PICK ENTRY OK]=ON AND DI[3:FROM R23 CLEAR]=ON AND DI[8:P3 PICK START]=ON AND DI[40:ENABLE P3 L]=ON,JMP LBL[110] ;
  49:   ;
  50:  IF DI[1:P3 PICK ENTRY OK]=ON AND DI[3:FROM R23 CLEAR]=ON AND DI[8:P3 PICK START]=ON,JMP LBL[120] ;
  51:   ;
  52:  IF DI[1:P3 PICK ENTRY OK]=ON AND DI[3:FROM R23 CLEAR]=ON AND DI[40:ENABLE P3 L]=ON,JMP LBL[130] ;
  53:  IF DI[29:CYCLE STOP]=ON,JMP LBL[90] ;
  54:  JMP LBL[20] ;
  55:   ;
  56:  LBL[110:L R PART] ;
  57:  WAIT DI[1:P3 PICK ENTRY OK]=ON AND DI[3:FROM R23 CLEAR]=ON AND DI[8:P3 PICK START]=ON AND DI[40:ENABLE P3 L]=ON    ;
  58:  TIMER[3]=START ;
  59:J P[3:PICK APPROACH] 100% CNT20 ACC100    ;
  60:   ;
  61:J P[4:PICK] 100% CNT0 TB R[18]sec,CALL PARTPICK ACC100 BREAK    ;
  62:  PAYLOAD[4] ;
  63:  CALL CHK_PICK    ;
  64:  MONITOR Z_CHECH ;
  65:J P[5:PICK DEPART] 100% CNT0 ACC100    ;
  66:  DO[8:P3 PARTS OUT]=PULSE,1.0sec ;
  67:  DO[42:P3 PART L OUT]=PULSE,0.5sec ;
  68:J P[6] 100% CNT70 ACC100    ;
  69:  MONITOR END Z_CHECH ;
  70:  WAIT DI[39:P3 LEFT PART ON]=OFF    ;
  71:J P[14:DROP R PART] 100% CNT5 ACC100 TB R[19]sec,CALL PARTDROP_R    ;
  72:  DO[41:P3 L PART ON]=PULSE,1.0sec ;
  73:J P[16:PICK L DEPART] 100% CNT30 ACC100    ;
  74:J P[15:CLEAR L PART] 100% CNT100 ACC100    ;
  75:  IF DI[43:LAST BLANK]=ON,JMP LBL[115] ;
  76:  JMP LBL[30] ;
  77:  LBL[115:LAST BLANK] ;
  78:  DO[43:P3 LAST STAMPING START]=PULSE,1.0sec ;
  79:   ;
  80:  JMP LBL[30] ;
  81:   ;
  82:   ;
  83:  LBL[120:PICK R PART] ;
  84:  WAIT DI[1:P3 PICK ENTRY OK]=ON AND DI[3:FROM R23 CLEAR]=ON AND DI[8:P3 PICK START]=ON    ;
  85:  TIMER[3]=START ;
  86:  OVERRIDE=R[5:SPEED           ] ;
  87:J P[3:PICK APPROACH] 100% CNT50 ACC100    ;
  88:J P[4:PICK] 100% CNT0 TB R[18]sec,CALL PARTPICK_R ACC100 BREAK    ;
  89:  PAYLOAD[4] ;
  90:  CALL CHECKPICK_R    ;
  91:J P[5:PICK DEPART] 100% CNT40 ACC100    ;
  92:  DO[8:P3 PARTS OUT]=PULSE,1.0sec ;
  93:  WAIT DI[39:P3 LEFT PART ON]=OFF    ;
  94:J P[6] 100% CNT100    ;
  95:J P[14:DROP R PART] 100% CNT5 ACC100 TB R[19]sec,CALL PARTDROP_R    ;
  96:  DO[41:P3 L PART ON]=PULSE,0.5sec ;
  97:J P[16:PICK L DEPART] 100% CNT100 ACC100    ;
  98:J P[2:PICK POUNCE] 100% CNT100    ;
  99:  IF DI[1:P3 PICK ENTRY OK]=ON AND DI[3:FROM R23 CLEAR]=ON AND DI[43:LAST BLANK]=ON,JMP LBL[121] ;
 100:  JMP LBL[122] ;
 101:  LBL[122:NOT LAST BLANK] ;
 102:J P[2:PICK POUNCE] 50% CNT100 ACC100 TA R[20]sec,DO[5:TO R23 DROP START]=PULSE,1.0sec    ;
 103:  JMP LBL[20] ;
 104:  LBL[121:IS LAST BLANK] ;
 105:J P[2:PICK POUNCE] 50% CNT100 ACC100 TA    .10sec,DO[43:P3 LAST STAMPING START]=PULSE,1.0sec    ;
 106:  JMP LBL[20] ;
 107:   ;
 108:  LBL[130:PICK L PART] ;
 109:  WAIT DI[1:P3 PICK ENTRY OK]=ON AND DI[3:FROM R23 CLEAR]=ON AND DI[40:ENABLE P3 L]=ON    ;
 110:  TIMER[3]=START ;
 111:J P[3:PICK APPROACH] 100% CNT50 ACC100    ;
 112:   ;
 113:J P[4:PICK] 100% CNT0 TB R[18]sec,CALL PARTPICK_L ACC100 BREAK    ;
 114:  PAYLOAD[4] ;
 115:  CALL CHECKPICK_L    ;
 116:  MONITOR Z_CHECH_L ;
 117:J P[5:PICK DEPART] 100% CNT70 ACC100    ;
 118:  DO[42:P3 PART L OUT]=PULSE,1.0sec ;
 119:J P[15:CLEAR L PART] 100% CNT100 ACC100 TA    .20sec,DO[5:TO R23 DROP START]=PULSE,1.0sec    ;
 120:  JMP LBL[30] ;
 121:   ;
 122:   ;
 123:   ;
 124:  LBL[30:GOTO DROP POUNCE] ;
 125:J P[8:DROP POUNCE] 100% CNT100 ACC100 BREAK    ;
 126:   ;
 127:  TIMER[3]=STOP ;
 128:  LBL[40:AT DROP POUNCE] ;
 129:  IF DI[2:P4 DROP ENTRY]=ON AND DI[4:FROM R45 CLEAR]=ON AND DI[5:P4 DROP START]=ON,JMP LBL[80] ;
 130:  IF DI[7:PRESS STAMPING COMPLETE]=ON AND DI[2:P4 DROP ENTRY]=ON,JMP LBL[50] ;
 131:  IF DI[18:MOVE TO CLEAR POS]=ON,JMP LBL[60] ;
 132:  JMP LBL[40] ;
 133:   ;
 134:  LBL[50:MOVE DROP SNEAK] ;
 135:  TIMER[3]=START ;
 136:  OVERRIDE=R[5:SPEED           ] ;
 137:J P[9:DROP SNEAK] 100% CNT100 ACC100 BREAK    ;
 138:  LBL[51:DROP OR C-P-S] ;
 139:  IF DI[2:P4 DROP ENTRY]=ON AND DI[4:FROM R45 CLEAR]=ON AND DI[5:P4 DROP START]=ON,JMP LBL[80] ;
 140:  IF DI[18:MOVE TO CLEAR POS]=ON,JMP LBL[40] ;
 141:  JMP LBL[51] ;
 142:  JMP LBL[50] ;
 143:   ;
 144:  LBL[60:MOVE CLS-PRS-ACC] ;
 145:J P[1:MIDDLE] 50% CNT100 ACC100    ;
 146:  PAUSE ;
 147:  JMP LBL[30] ;
 148:   ;
 149:  LBL[80:DROP ENABLED] ;
 150:  !PROCEED TO DROP ;
 151:  TIMER[3]=START ;
 152:  OVERRIDE=R[5:SPEED           ] ;
 153:J P[10:DROP APPROACH] 100% CNT5 ACC100    ;
 154:  MONITOR END Z_CHECH_L ;
 155:J P[11:DROP] 100% CNT5 TB R[19]sec,CALL PARTDROP ACC100 BREAK    ;
 156:  DO[6:PART DROP COMPLETE]=PULSE,1.0sec ;
 157:  PAYLOAD[3] ;
 158:  CALL CHK_DROP    ;
 159:   ;
 160:J P[12:DROP DEPART] 100% CNT50 ACC100    ;
 161:J P[13:DROP CLEAR] 100% CNT100 ACC100    ;
 162:  DO[7:PRESS STAMPING START]=PULSE,1.0sec ;
 163:  !GOTO PICK POUNCE ;
 164:J P[2:PICK POUNCE] 100% CNT100 ACC100 BREAK    ;
 165:  IF DI[29:CYCLE STOP]=ON,JMP LBL[90] ;
 166:  JMP LBL[10] ;
 167:   ;
 168:  LBL[90:END OF CYCLE] ;
 169:  TIMER[1]=STOP ;
 170:  R[4:TOTAL CYCLE TIME]=TIMER[1]    ;
 171:J P[1:MIDDLE] 50% CNT100    ;
 172:  MOVE TO HOME    ;
 173:   ;
 174:  LBL[100:END OF PROGRAM] ;
/POS
P[1:"MIDDLE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2086.456  mm,	Y =     -.007  mm,	Z =  -901.000  mm,
	W =  -180.000 deg,	P =     -.000 deg,	R =  -180.000 deg,
	E1=   107.700 deg
};
P[2:"PICK POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2072.355  mm,	Y =  1265.661  mm,	Z =  -901.041  mm,
	W =   179.324 deg,	P =     1.370 deg,	R =   150.803 deg,
	E1=   135.022 deg
};
P[3:"PICK APPROACH"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2634.117  mm,	Y =  3280.866  mm,	Z =  -856.893  mm,
	W =  -179.782 deg,	P =    -2.398 deg,	R =    89.215 deg,
	E1=   196.308 deg
};
P[4:"PICK"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2634.116  mm,	Y =  3280.866  mm,	Z = -1032.574  mm,
	W =  -179.782 deg,	P =    -2.398 deg,	R =    89.215 deg,
	E1=   196.308 deg
};
P[5:"PICK DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2634.118  mm,	Y =  3280.866  mm,	Z =  -805.213  mm,
	W =  -179.782 deg,	P =    -2.398 deg,	R =    89.215 deg,
	E1=   196.308 deg
};
P[6]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2646.463  mm,	Y =  3237.972  mm,	Z =  -804.955  mm,
	W =  -179.852 deg,	P =     -.435 deg,	R =    89.057 deg,
	E1=    16.126 deg
};
P[8:"DROP POUNCE"]{
   GP1:
	UF : 0, UT : 1,	
	J1=     4.866 deg,	J2=   -20.856 deg,	J3=    59.636 deg,
	J4=     -.658 deg,	J5=   -58.754 deg,	J6=   179.786 deg,
	E1=   104.954 deg
};
P[9:"DROP SNEAK"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2237.341  mm,	Y =  -934.488  mm,	Z =  -864.961  mm,
	W =   177.336 deg,	P =      .322 deg,	R =  -148.144 deg,
	E1=   193.371 deg
};
P[10:"DROP APPROACH"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2664.875  mm,	Y = -3213.817  mm,	Z =  -880.471  mm,
	W =   178.946 deg,	P =     -.668 deg,	R =   -92.883 deg,
	E1=   198.046 deg
};
P[11:"DROP"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2664.873  mm,	Y = -3213.817  mm,	Z = -1007.271  mm,
	W =   178.946 deg,	P =     -.668 deg,	R =   -92.883 deg,
	E1=   198.046 deg
};
P[12:"DROP DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2664.875  mm,	Y = -3213.817  mm,	Z =  -880.471  mm,
	W =   178.946 deg,	P =     -.668 deg,	R =   -92.883 deg,
	E1=   198.046 deg
};
P[13:"DROP CLEAR"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2043.417  mm,	Y =  -966.069  mm,	Z =  -889.078  mm,
	W =  -179.114 deg,	P =      .402 deg,	R =  -159.397 deg,
	E1=   162.271 deg
};
P[14:"DROP R PART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2619.102  mm,	Y =  3299.084  mm,	Z =  -941.433  mm,
	W =  -178.201 deg,	P =    -1.103 deg,	R =    89.037 deg,
	E1=    16.126 deg
};
P[15:"CLEAR L PART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  1995.805  mm,	Y =   612.943  mm,	Z =  -898.818  mm,
	W =   179.636 deg,	P =     1.663 deg,	R =   174.237 deg,
	E1=    72.481 deg
};
P[16:"PICK L DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2619.303  mm,	Y =  3296.462  mm,	Z =  -854.582  mm,
	W =  -178.211 deg,	P =    -1.111 deg,	R =    89.037 deg,
	E1=    16.126 deg
};
/END
